/*
 * Delegate.java  0.4.0 / Nov 6, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
package com.cute4j.tools.ng.delegate;

import java.io.File;
import java.io.IOException;

import com.thoughtworks.qdox.model.JavaClass;

/**
 * Delegate Generator.
 *
 * @author Slobodan Vrkacevic
 * @version 0.4.0
 */
public class Delegate {

// Private Fields. -------------------------------------------------------------

  private final DelegateHFile delegateHFile;
  private final DelegateCppFile delegateCppFile;

// Public Constructors. --------------------------------------------------------

  /**
   * Constructs new Delegate object.
   *
   * @param delegateFolder the delegate folder
   * @param javaClass  the qdox java class
   */
  public Delegate(File delegateFolder, JavaClass javaClass) {
    delegateHFile = new DelegateHFile(delegateFolder, javaClass);
    delegateCppFile = new DelegateCppFile(delegateFolder, javaClass);
  }

// Public Methods. -------------------------------------------------------------

  /**
   * Loads delegate files.
   *
   * @throws IOException if any I/O exception occurred
   */
  public void load() throws IOException {
    delegateHFile.load();
    delegateCppFile.load();
  }

  /**
   * Stores delegate files.
   *
   * @throws IOException if any I/O exception occurred
   */
  public void store() throws IOException {
    delegateHFile.store();
    delegateCppFile.store();
  }

}
